﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting.Channels;
using System.Reflection;

namespace SanguoSharp
{

    internal class MethodRestrictionServerSinkProvider : IServerChannelSinkProvider
    {
        private IServerChannelSinkProvider next;

        public Predicate<MethodBase> Filter
        {
            get;
            set;
        }
        public IServerChannelSinkProvider Next
        {
            get { return next; }
            set { next = value; }
        }

        public MethodRestrictionServerSinkProvider()
        {
            Filter = t => true;
        }

        public IServerChannelSink CreateSink(IChannelReceiver channel)
        {
            IServerChannelSink nextSink = null;
            if (next != null)
                nextSink = next.CreateSink(channel);
            return new MethodRestrictionServerSink(this, nextSink);
        }
        public void GetChannelData(IChannelDataStore channelData)
        {
        }
    }
}
